package com.java.jvm.loader;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

public class SimpleUrlClassLoaderTests {
    public static void main(String[] args) throws MalformedURLException, ClassNotFoundException {
        File file=new File("E:\\TCGBIV\\DEVCODES\\CGB2202CODES");
        URL[] urls={file.toURI().toURL()};
        //你自己写类加载？(你为什么要写这个类加载器你是不是要知道)
        SimpleUrlClassLoader classLoader=
                new SimpleUrlClassLoader(urls,ClassLoader.getSystemClassLoader());//null (BootStrapClassLoader)
        Class<?> aClass = classLoader.loadClass("pkg.HelloJVM");
        System.out.println(aClass.getClassLoader());
    }
}
